package com.knowledge.business.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
        import com.knowledge.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.knowledge.business.mapper.SysDeviceMapper;
import com.knowledge.business.domain.SysDevice;
import com.knowledge.business.service.ISysDeviceService;

/**
 * 设备信息Service业务层处理
 *
 * @author zhaoyk
 * @date 2025-09-23
 */
@Service
public class SysDeviceServiceImpl extends ServiceImpl<SysDeviceMapper,SysDevice>  implements ISysDeviceService
{
    @Autowired
    private SysDeviceMapper sysDeviceMapper;

    /**
     * 查询设备信息
     *
     * @param deviceId 设备信息主键
     * @return 设备信息
     */
    @Override
    public SysDevice selectSysDeviceByDeviceId(String deviceId)
    {
        return sysDeviceMapper.selectSysDeviceByDeviceId(deviceId);
    }

    /**
     * 查询设备信息列表
     *
     * @param sysDevice 设备信息
     * @return 设备信息
     */
    @Override
    public List<SysDevice> selectSysDeviceList(SysDevice sysDevice)
    {
        return sysDeviceMapper.selectSysDeviceList(sysDevice);
    }

    /**
     * 新增设备信息
     *
     * @param sysDevice 设备信息
     * @return 结果
     */
    @Override
    public int insertSysDevice(SysDevice sysDevice)
    {
                sysDevice.setCreateTime(DateUtils.getNowDate());
            return sysDeviceMapper.insertSysDevice(sysDevice);
    }

    /**
     * 修改设备信息
     *
     * @param sysDevice 设备信息
     * @return 结果
     */
    @Override
    public int updateSysDevice(SysDevice sysDevice)
    {
                sysDevice.setUpdateTime(DateUtils.getNowDate());
        return sysDeviceMapper.updateSysDevice(sysDevice);
    }

    /**
     * 批量删除设备信息
     *
     * @param deviceIds 需要删除的设备信息主键
     * @return 结果
     */
    @Override
    public int deleteSysDeviceByDeviceIds(String[] deviceIds)
    {
        return sysDeviceMapper.deleteSysDeviceByDeviceIds(deviceIds);
    }

    /**
     * 删除设备信息信息
     *
     * @param deviceId 设备信息主键
     * @return 结果
     */
    @Override
    public int deleteSysDeviceByDeviceId(String deviceId)
    {
        return sysDeviceMapper.deleteSysDeviceByDeviceId(deviceId);
    }
}
